package neuralNetworks.evolution;

import java.util.ArrayList;
import java.util.List;

import neuralNetworks.Functions;
import neuralNetworks.NeuralNetworkFactory;
import neuralNetworks.Neuron;

public class GenerationCreator<T extends EvolutionNet> {

	NeuralNetworkFactory<? extends T> netFact;

	public GenerationCreator(Class<? extends T> netClass, Class<? extends Neuron> neuronClass) {
		this.netFact = new NeuralNetworkFactory<>(netClass, neuronClass);
	}

	public List<T> create(int generationSize, int[] layer, Functions actFunc) throws InstantiationException,
			IllegalAccessException {
		List<T> generation = new ArrayList<>();
		for (int i = 0; i < generationSize; i++) {
			T net = netFact.create(layer, actFunc);
			generation.add(net);
		}
		return generation;
	}

}
